//
//
//

#ifndef SIMPLE_MATRIX_MULTER_H
#define SIMPLE_MATRIX_MULTER_H

// Matrices are stored in row-major order: 
// M(row, col) = *(M.elements + row * M.width + col) 

typedef struct { 
	int width; 
	int height;
	float* elements;

	inline float &operator() (int row, int col) { return this->elements[row * this->width + col]; };
} Matrix; 

// Thread block size 

#define BLOCK_SIZE 16

// Forward declaration of the matrix multiplication kernel 
__global__ void MatMulKernel(const Matrix, const Matrix, Matrix); 

// Matrix multiplication - Host code 
// Matrix dimensions are assumed to be multiples of BLOCK_SIZE 
void MatMul(const Matrix A, const Matrix B, Matrix C);

// MatMul ``unit test''
void testMatMul();

#endif
